package ooday04;

public abstract class Animal {
    String name;
    int age;
    String colour;

    Animal(String name, int age, String colour) {
        this.name = name;
        this.age = age;
        this.colour = colour;
    }

    void drink() {
        System.out.println(colour + "色的" + age + "岁的" + name + "正在喝水...");
    }

    abstract void eat();
}

class Dog extends Animal implements Swim {
    Dog(String name, int age, String colour) {
        super(name, age, colour);
    }

    void lookhome() {
        System.out.println(colour + "色的" + age + "岁的" + name + "正在看家...");
    }

    void eat() {
        System.out.println(colour + "色的" + age + "岁的" + name + "正在吃骨头...");
    }

    public void swim() {
        System.out.println(colour + "色的" + age + "岁的" + name + "正在游泳..");
    }
}

class Fish extends Animal implements Swim {
    Fish(String name, int age, String colour) {
        super(name, age, colour);
    }

    void eat() {
        System.out.println(colour + "色的" + age + "岁的" + name + "正在吃小虾...");
    }

    public void swim() {
        System.out.println(colour + "色的" + age + "岁的" + name + "正在游泳..");
    }
}

class Chick extends Animal {
    Chick(String name, int age, String colour) {
        super(name, age, colour);
    }

    void layeggs() {
        System.out.println(colour + "色的" + age + "岁的" + name + "正在下蛋...");
    }

    void eat() {
        System.out.println(colour + "色的" + age + "岁的" + name + "正在吃小米...");
    }

}